# -*- coding: utf-8 -*-
import os

#builtins import
import wx
#core util import
import pystore.core.i18n as i18n
import pystore.core.framework.logger as logger
import framework
_t=i18n.t_
_log=logger.getLog('ui') 

class PathValidator(framework.BaseValidator):

    def Clone(self):
        return PathValidator(self.errorHandler)

    def Validate(self, win):
        w=self.GetWindow()
        v = w.GetValue()
        if not os.path.exists(v):
            self.setError(w,_t('dir is not exists'))
            return False
        self.clearError(w)
        return True

